#pragma once
/*!
* \file  ui_single_object_control.h
* \brief 
* 
*
* 
* \author patdz@qq.com
* \version 1.0
* \date 2014/06/21
*/
#include "ui_control.h"

_SSL_BEGIN
_SSUIL_BEGIN

#pragma warning(push)
#pragma warning(disable:4250)

class UISingleObjectControl :
	public UIControl
{
public:
	UISingleObjectControl();
	virtual ~UISingleObjectControl();

public:
	virtual UINT GetProperties();
	virtual void DoEvent(UIEvent &evt);
	virtual bool AddChild(IUIControlInterface *control);
	virtual bool RemoveChild(IUIControlInterface *control);
	virtual scoped_ref_ptr<IUIControlInterface> FindControl(FindControlCB cb, void *data, unsigned int flags);
	virtual void OnWindowManagerChangedCB(IUIManagerInterface *old_manager, IUIManagerInterface *new_manager);

protected:
	bool DelegateOnItemStateChanged(void *tag);
	bool DelegateOnItemEvent(void *tag);

protected:
	scoped_ref_ptr<IUIControlInterface> to_over_control_;
	scoped_ref_ptr<IUIControlInterface> to_press_control_;
	scoped_ref_ptr<IUIControlInterface> overed_control_;
	scoped_ref_ptr<IUIControlInterface> pressed_control_;
};

#pragma warning(pop)

_SSUIL_END
_SSL_END
